<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$plugin_name = $_RQ['basicname'] ? $_RQ['basicname'] : '';
if($_RQ['op']=='get'){
	//显示统计数据
		$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
		$mounthtime =  mktime(0,0,0,date('m'),1,date('Y'));
		$itemsum=array();
		//今日帖子
		$itemsum['item0_day']=pdo_count('jy_merch_game_item',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_fx','createtime >'=>$daytime));
		$itemsum['item1_day']=pdo_count('jy_merch_game_item',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_pt','createtime >'=>$daytime));
		$itemsum['item2_day']=pdo_count('jy_merch_game_item',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_ms','createtime >'=>$daytime));
		//总帖子
		$itemsum['item0_all']=pdo_count('jy_merch_game_item',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_fx'));
		$itemsum['item1_all']=pdo_count('jy_merch_game_item',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_pt'));
		$itemsum['item2_all']=pdo_count('jy_merch_game_item',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_ms'));
		
		//总接龙
		$itemsum['jili0_all']=pdo_count('jy_merch_game_order',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_fx'));
		$itemsum['jili1_all']=pdo_count('jy_merch_game_order',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_pt'));
		$itemsum['jili2_all']=pdo_count('jy_merch_game_order',array('uniacid'=>$_SESSION['uniacid'],'gamename'=>'jy_merchgame_ms'));
		$htmls=array(
				array('type'=>'data','tpltype'=>1,'one_num'=>3,'title'=>'应用今日/总帖子数据指标','datas'=>array(
					array('title'=>'种草活动','num'=>2,'data'=>array($itemsum['item0_day'],$itemsum['item0_all'])),
					array('title'=>'拼团活动','num'=>2,'data'=>array($itemsum['item1_day'],$itemsum['item1_all'])),
					array('title'=>'秒杀活动','num'=>2,'data'=>array($itemsum['item2_day'],$itemsum['item2_all'])),
				)),
				array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'wechat','title'=>'总数据指标','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'种草活动','value'=>$itemsum['item0_all']),
						array('name'=>'拼团活动','value'=>$itemsum['item1_all']),
						array('name'=>'秒杀活动','value'=>$itemsum['item2_all']),
					),
				)),
				array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'wxapp','title'=>'订单数据指标','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'种草活动','value'=>$itemsum['jili0_all']),
						array('name'=>'拼团活动','value'=>$itemsum['jili1_all']),
						array('name'=>'秒杀活动','value'=>$itemsum['jili2_all']),
					),
				)),
	);
	$return['htmls']=$htmls;
	exi($return);
}